package com.mvs.sillybat;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.audio.Music;
import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Animation;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.TextureRegion;

public class Assets {
	public static TextureRegion backgroundRegion;
	public static TextureRegion backgroundRegion2;
	public static TextureRegion logo;
	public static TextureRegion play;
	public static TextureRegion highscore;
	public static TextureRegion help;
	public static TextureRegion backbutton;
	public static Texture background;
	public static Texture background2;
	public static Texture Bot1, Bot2;
	public static Texture jumpFire;
	public static Animation Robot;
	public static Sound explode;
	public static Texture platform;
	public static TextureRegion ready;
	public static TextureRegion gameOver;
	public static Sound jumpSound;
	public static Sound highJumpSound;
	public static Sound hitSound;
	public static Sound coinSound;
	public static Sound clickSound;
	public static Music music;

	public static Texture loadTexture(String file) {
		return new Texture(Gdx.files.internal(file));
	}

	public static void load() {
		background = new Texture(Gdx.files.internal("backgroundgame.png"));
		backgroundRegion = new TextureRegion(background, 0, 0, 480, 800);
		background2 = new Texture(Gdx.files.internal("backgroundgame.png"));
		backgroundRegion2 = new TextureRegion(background2, 0, 0, 480, 800);
		logo = new TextureRegion(new Texture(Gdx.files.internal("FlyingBot_Logo2.png")));
		play = new TextureRegion(new Texture(Gdx.files.internal("play.png")));
		highscore = new TextureRegion(new Texture(Gdx.files.internal("highscore.png")));
		help = new TextureRegion(new Texture(Gdx.files.internal("help.png")));
		backbutton = new TextureRegion(new Texture(Gdx.files.internal("backicon.png")));
		
		Bot1 = new Texture(Gdx.files.internal("bot1.png"));
		Bot2 = new Texture(Gdx.files.internal("bot2.png"));
		jumpFire = new Texture(Gdx.files.internal("jumpFire.png"));
		
		platform = new Texture(Gdx.files.internal("platform.png"));

		explode = Gdx.audio.newSound(Gdx.files.internal("explode.wav"));
		music = Gdx.audio.newMusic(Gdx.files.internal("music.mp3"));
		music.setLooping(true);
		music.setVolume(0.3f);
		music.play();

		ready = new TextureRegion(new Texture(Gdx.files.internal("ready.png")));
		gameOver = new TextureRegion(new Texture(
				Gdx.files.internal("gameover.png")));

		jumpSound = Gdx.audio.newSound(Gdx.files.internal("jump.wav"));
		highJumpSound = Gdx.audio.newSound(Gdx.files.internal("highjump.wav"));
		hitSound = Gdx.audio.newSound(Gdx.files.internal("explode.wav"));
		coinSound = Gdx.audio.newSound(Gdx.files.internal("coin.wav"));
		clickSound = Gdx.audio.newSound(Gdx.files.internal("click.wav"));
	}

	public static void playSound(Sound sound) {
		// if (Settings.soundEnabled)
		sound.play(1);
	}
}
